package com.fiewolf.lol.handlers;

import java.util.Collection;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fiewolf.lol.entities.Menu;
import com.fiewolf.lol.entities.User;
import com.fiewolf.lol.service.IMenuService;

/**
 * 菜单处理器
 * 
 * @author lx
 *
 */
@Controller
@RequestMapping("menu")
public class MenuHandler {

	@Autowired
	private IMenuService mService;

	@RequestMapping("qrymenus")
	public @ResponseBody Collection<Menu> qryMenus(HttpSession session) {
		Collection<Menu> menus = mService.findAllMenus(((User) session.getAttribute("curUser")).getName());
		return menus;
	}
}
